package com.emip.service.impl;

import java.util.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.emip.bean.HourStoreBean;
import com.emip.dao.HourStoreDAO;
import com.emip.service.HourStoreService;


@Service("hourStoreService")
public class HourStoreServiceImpl implements HourStoreService {

	@Autowired
	HourStoreDAO hourStoreDAO;
	
	public List<HourStoreBean> getByTimespan(String startDate, String endDate, String[] itemIds, String siteId) {
		return hourStoreDAO.getByTimespan(startDate, endDate, itemIds, siteId);
	}

	public HourStoreBean merge(HourStoreBean store) {
		return hourStoreDAO.merge(store);
	}

	public List<HourStoreBean> getByTimespan(String startDate, String endDate,
			String[] itemIds, String siteId, int page, int size) {
		return hourStoreDAO.getByTimespan(startDate, endDate, itemIds, siteId, page, size);
	}
	
	public List<Date> getSEDate(String startDate, String endDate) {
		return hourStoreDAO.getSEDate(startDate, endDate);
	}

	public long getCount(String startDate, String endDate, String[] itemIds,
			String siteId) {
		return hourStoreDAO.getCount(startDate, endDate, itemIds, siteId);
	}

	public HourStoreBean findById(int id) {
		return hourStoreDAO.findById(id);
	}

	public Date getLastDate(String itemId, String siteId) {
		return hourStoreDAO.getLastDate(itemId, siteId);
	}

	public List<HourStoreBean> getLastNItemsBySiteID(String siteId,
			String itemId, int num) {
		return hourStoreDAO.getLastNItemsBySiteID(siteId, itemId, num);
	}

	public Object[] getStatistics(String startDate, String endDate,
			String itemIds, String siteId) {
		return hourStoreDAO.getStatistics(startDate, endDate, itemIds, siteId);
	}

	public HourStoreBean findByHour(String date, String siteId, String itemId) {
		return hourStoreDAO.findByHour(date, siteId, itemId);
	}

}
